import { DELETE, GET, POST, PUT } from '@/http';

export const addCarousel = (data = {
  link: '',
  path: '',
  orders: 0
}) => {
  return POST({
    url: '/rotationChart/addRotationChart',
    data: data
  });
};

export const getCarouselList = (params) => {
  return GET({
    url: '/rotationChart/getRotationChartList',
    params
  });
};

export const updateCarousel = (data = {
  'id': 0,
  link: '',
  path: '',
  orders: 0
}) => {
  return PUT({
    url: '/rotationChart/updateRotationChart',
    data: data
  });
};

export const getCarouselDetail = (id) => {
  return GET({
    url: '/rotationChart/getRotationChartDetailsById',
    params: {
      id
    }
  });
};

// http://localhost:8166/article/deleteArticle

export const deleteCarousel = (id) => {
  return DELETE({
    url: '/rotationChart/deleteRotationChart',
    params: {
      id: id[0]
    }
  });
};
